<script setup>
import { ref,reactive } from "vue";
import router from "../../router/index";
import store from "../../store/index";
const formRef = ref({});
const form = ref({
  username: "admin",
  password: "111111",
});
const denglu = async () => {
  await store.dispatch("denglu/doLogin",form._rawValue)
  router.push("/layout");
};

</script>

<template>
  <div class="banj">
    <div class="gl_fw">
      <div class="tupian">
        <img src="../../image/u49.png" alt="" />
      </div>
      <div class="you">
        <div class="gli">后台管理系统</div>
        <div class="form_el">
          <el-form
            ref="formRef"
            :model="form"
            label-width="80px"
            :rules="rules"
            class="input_al"
          >
            <el-input v-model="form.username" placeholder="手机号码" />
            <el-input
              v-model="form.password"
              type="password"
              placeholder="登录密码"
              show-password
            />
            <el-button type="primary" @click="denglu">登录</el-button>
          </el-form>
        </div>
      </div>
    </div>
  </div>
</template>

<style>
.banj {
  width: 100%;
  height: 100vh;
  background-color: rgba(16, 142, 233, 1);
  display: flex;
  justify-content: center;
  align-items: center;
}
.gl_fw {
  width: 550px;
  height: 400px;
  background-color: rgba(255, 255, 255, 1);
}
.tupian {
  width: 300px;
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.tupian img {
  max-width: 100%;
  max-height: 100%;
}

.gl_fw {
  display: flex;
  align-items: center;
  display: flex;
  justify-content: space-between;
  align-items: center;
  display: flex;
}

.you {
  width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.input_al {
  display: flex;
  flex-direction: column;
  height: 120px;
  justify-content: space-between;
}
.gli {
  margin-top: 20px;
}
.form_el {
  padding-top: 46px;
}

.gli {
  font-size: 26px;
  font-weight: 900;
}
</style>